# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo12
# Description:
# Author:       98745
# Date:         2019/6/9
#-------------------------------------------------------------------------------

from flask import Flask,render_template

app=Flask(__name__)

class MyItem:
    def __init__(self,id,name):
        self.id=id
        self.name=name

@app.route('/')
def index():
    return render_template('macro.txt',items1=[MyItem(100,'hello'),{'id':2,'name':'liang'},{'id':3,'name':'may'}],
                           items2=[MyItem(200,'world'),MyItem(400,'new')],
                           items3=(MyItem(800,'123'),MyItem(1600,'horse')))



if __name__ == '__main__':
    app.run()
# from flask import Flask,render_template
# app = Flask(__name__)
#
#
# class MyItem:
#     def __init__(self,id,name):
#         self.id = id
#         self.name = name
# @app.route('/')
# def index():
#     return render_template('macro.txt',
#                            items1=[MyItem(100,'Hello'),
#                                   {'id':2,'name':'John'},
#                                    {'id':3,'name':'Mary'}],
#                             items2=[MyItem(200,'World'),
#                                   MyItem(400,'New')
#                                    ],
#                            items3=(MyItem(800,'123'),
#                                   MyItem(1600,'Horse')
#                                    ))
# if __name__ == '__main__':
#     app.run()